<template>
  <bd-popup
    popupId="lotteryV3UpdatePopup"
    :weights="4"
    v-model:show="props.show"
    :style="{
      overflow: 'initial',
      width: '80%',
      'background-color': 'transparent',
    }"
    zIndex="999999"
    teleport="body"
    :close-on-click-overlay="false"
  >
    <div class="box-bg">
      <div class="box items-center">
        <img class="box-img" src="/image/update-icon.svg" />
        <div class="box-title">
          {{ title ? title : $t("lotteryMoney.updateing") }}
        </div>
        <div class="box-desc">
          {{ desc ? desc : $t("lotteryMoney.updateingDesc") }}
        </div>
      </div>
      <!-- 确认 -->
      <div class="box-footer items-center">
        <div class="box-footer-item" @click.stop="confirm">
          {{ btnTitle ? btnTitle : $t("mvp.other.zdl") }}
        </div>
      </div>
    </div>
    <!-- 关闭 -->
    <img
      class="close"
      src="/image/close-fff-icon.svg"
      @click.stop="closePopup"
    />
  </bd-popup>
</template>
<script setup lang="ts" name="hashValuePopup">
import { ref, reactive, onMounted, computed, nextTick } from "vue";
const props = withDefaults(
  defineProps<{
    show: boolean;
    title?: string;
    desc?: string;
    btnTitle?: string;
    type: number;
  }>(),
  {
    show: false,
    type: 1, // 1 老版本抽奖, 2,lotteryv3 抽奖
  }
);

const emit = defineEmits(["update:show", "confirm"]);

onMounted(() => {});
onBeforeUnmount(() => {});

// 确认
const confirm = () => {
  emit("confirm");
  emit("update:show", false);
};

// 关闭弹窗
const closePopup = () => {
  emit("update:show", false);
};
</script>
<style lang="scss" scoped>
.popupview {
  overflow: initial;
}
.box {
  justify-content: center;
  flex-direction: column;
  padding: 20 * 2px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);

  &-bg {
    border-radius: 12 * 2px;
    background-color: #fff;
    padding-bottom: 10 * 2px;
  }

  &-img {
    width: 80 * 2px;
    height: 80 * 2px;
    margin-bottom: 12 * 2px;
  }
  &-title {
    text-align: center;
    color: #141924;
    font-size: 14 * 2px;
    font-weight: 510;
    margin-bottom: 12 * 2px;
  }
  &-desc {
    text-align: center;
    color: #999da7;
    font-size: 13 * 2px;
    font-weight: 400;
  }

  &-footer {
    margin: 10 * 2px 15 * 2px;
    margin-bottom: 0;
    justify-content: center;
    &-item {
      margin: 0 5 * 2px;
      width: 100%;
      background-color: #007bff;
      padding: 10 * 2px 0;
      border-radius: 6 * 2px;
      text-align: center;
      color: #fff;
      font-size: 15 * 2px;
      font-weight: 590;
    }
  }
}
.close {
  position: absolute;
  z-index: 9;
  bottom: -50 * 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 30 * 2px;
  height: 30 * 2px;
}
</style>
